// 2025/9/23
// 牛牛的快递

#include <iostream>
using namespace std;

int main() {
    float a; char b;
    cin >> a >> b;
    long long weight = a + ((int)a == a ? 0 : 1);
    long long ans = (b == 'y' && weight != 0) ? 5 : 0;
    if(weight >= 1)
    {
        ans += 20;
        weight--;
    }
    ans += weight;
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")